package com.hou.shopping.product.condig;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableTransactionManagement  //开启事务
@MapperScan(basePackages = "com.hou.shoppinng.product.dao")
public class MyBatisConfig {
    //    分页插件
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        paginationInterceptor.setOverflow(true);//
        paginationInterceptor.setLimit(1000);//每页最大限制1000条
        return paginationInterceptor;
    }
}
